﻿<script type="text/javascript" charset="utf-8">
	$(function() {
		$('#registerDialog').show().dialog({
			modal : true,
			closed : true,
			buttons : [ {
				text : '注册',
				handler : function() {
					register();
				}
			} ]
		});
	});
	function register() {
		if ($('#regForm').form('validate')) {
			parent.$.messager.progress({
				title : '提示',
				text : '数据处理中，请稍后....'
			});
			$.post('${pageContext.request.contextPath}/userController/reg', $('#regForm').serialize(), function(result) {
				if (result.success) {
					$('#registerDialog').dialog('close');
					$.messager.show({
						title : '提示',
						msg : result.msg,
						showType : 'slide'
					});
					$('#loginForm').form('load', result.obj);
				} else {
					$.messager.alert('错误', result.msg, 'error');
				}
				parent.$.messager.progress('close');
			}, "JSON");
		}
	}
</script>
<div id="registerDialog" title="用户注册" style="width: 300px; height: 220px; overflow: hidden; display: none;">
